<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>旋转</title>
    <style>
      .box {
        width: 300px;
        height: 300px;
        margin: 100px auto;
        perspective: 800px;
        transform-style: preserve-3d;
        animation: rotate 5s linear infinite;
        transform: rotate3d(1, 0, 0, 45deg);
      }
      .item {
        width: 100px;
        height: 100px;
        transform-style: preserve-3d;
        position: absolute;
      }
      .item1 {
        transform: translate3D(0px, 0px, -43px) rotateY(0px);
        background-color: #f00;
      }
      .item2 {
        transform: translate3D(-26px, 0px, -43px) rotateY(60deg);
        background-color: #0f0;
      }
      .item3 {
        transform: translate3D(26px, 0px, -43px) rotateY(120deg);
        background-color: #00f;
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="item item1"></div>
      <div class="item item2"></div>
      <div class="item item3"></div>
    </div>
  </body>
</html>
